Linking text within a document to a reference or entity is a useful feature that helps a user understand elements of any given document. Also important is that the linking provides structure that enables downstream applications and algorithms to compute over previously unstructured text in a more effective way. For example, if a search engine is to be built, knowing that a document refers to Python the snake, as opposed to the programming language, is helpful and will significantly improve the product experience. For scaling purposes, a process automatically analyzes texts, selects a set of text elements from a text environment, and links each text element to a reference or entity. The entity comprises a concept associated with a definition—for instance, a dictionary, knowledge base, or encyclopedia entry. In a text environment with cleanly defined context—for example a newspaper or journal article—linking a text element to an entity is straightforward. The article context can be used to disambiguate between multiple possible entities associated with the text element. However, in noisy environments, a global article context is not easily determined. A local context could change every sentence or even change within a sentence. For example, when a text conversation (e.g., chat) between company employees is analyzed, the employees may discuss multiple subjects with different contexts in the same conversation. This creates a problem where automatically disambiguating between multiple possible entities to link with a text element is very difficult.